<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<s:if test="#request.taskView.isSelect==true">
<script type="text/javascript">
	<!--
	var nodeAndUserArr=new Array();
	var userIdArr;
	<s:iterator value="#request.taskView.childTaskNodeList">
	userIdArr=new Array();
    <s:if test="person!=null">
    	userIdArr.push({id:'<s:property value="person.id"/>',name:'<s:property value="person.name"/>'});
	</s:if>
	<s:iterator value="personList">
		userIdArr.push({id:'<s:property value="id"/>',name:'<s:property value="name"/>'});
	</s:iterator>
	nodeAndUserArr['<s:property value="id"/>']=userIdArr;
	</s:iterator>
	$(document).ready(function(){
		$('#taskNodeOneId').change(function(){
				var nodeId=this.value;
				$('#taskAssign-useId').empty();
				$('#taskAssign-useId').addOption('','');
				if(nodeId!=''){
					var tmpUser=nodeAndUserArr[nodeId];
					if(tmpUser){
						if(tmpUser.length>0){
							$('#nextNodeUserIdBtn').hide();
						}else{
							$('#nextNodeUserIdBtn').show();
						}
						$.each(tmpUser,function(index,obj){
							$('#taskAssign-useId').addOption(obj.name,obj.id);
						});
					}else{
						//$('#taskAssign-useId').addOption('','');
					}
				}else{
					//$('#taskAssign-useId').addOption('','');
				}
		});
	});
	-->
</script>
<div style="height: 25px">
<li style="padding: 0;list-style: upper-roman;">
<select id="taskNodeOneId" name="taskNodeId" style="width:150px"  dataType="Require" msg="必选">
	<option value="">------------请选择-----------</option>
	<s:iterator value="#request.taskView.childTaskNodeList">
	<option value="<s:property value="id"/>"><s:property value="name"/></option>
	</s:iterator>
</select>

<select name="userId" id="taskAssign-useId" style="width:180px" dataType="Require" msg="必选">
	<option value=""></option>
	<%--
    <s:iterator value="#request.taskView.childTaskNodeList">
    <s:if test="person!=null">
	<option value="<s:property value="person.id"/>"><s:property value="person.name"/></option>
	</s:if>
	<s:iterator value="personList">
	<option value="<s:property value="id"/>"><s:property value="name"/></option>
	</s:iterator>	
	</s:iterator>
	--%>
</select>
<button id="nextNodeUserIdBtn" type="button" onclick="selectMainAllPerson('taskAssign-useId')" style="margin-left: 5px;display: none;">选择人员</button>
</li>
</div>															
</s:if>
<s:else>
<s:iterator value="#request.taskView.childTaskNodeList">
<li style="padding: 0;list-style: upper-roman;margin-top: 2px">
<select name="taskNodeId" style="width:150px">
	<option value="<s:property value="id"/>"><s:property value="name"/></option>
</select>
<select name="userId" id="taskAssign-<s:property value="id"/>" style="width:180px" dataType="Require" msg="必选">
	<option value="<s:property value="person.id"/>"><s:property value="person.name"/></option>
	<s:iterator value="personList">
	<option value="<s:property value="id"/>"><s:property value="name"/></option>
	</s:iterator>
</select>
<s:if test="person!=null||(secRole!=null&&secRole!='')||(personList!=null&&personList.length>0)">

</s:if>
<s:else>
<button type="button" onclick="selectMainAllPerson('taskAssign-<s:property value="id"/>')" style="margin-left: 5px">选择人员</button>
</s:else>
<s:if test="secRole==null||secRole==''">

</s:if>
</li>
</s:iterator>
</s:else>


